package com.mes.system.dao;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.mes.common.dao.BasicDao;
import com.mes.system.dao.iface.ISysOperationAuthDao;
import com.mes.system.domain.SysOperationAuth;

@Repository
public class SysOperationAuthDao extends BasicDao<SysOperationAuth> implements ISysOperationAuthDao {

	private static final Log log = LogFactory.getLog(SysOperationAuthDao.class);

	@Override
	public List<SysOperationAuth> getAuthListByOperationUid(String sysOperationUid) {
		List<SysOperationAuth> list = null;
		try {
			Session session = this.getSession();
			Criteria crit = session.createCriteria(SysOperationAuth.class);
			crit.add(Restrictions.eq("sysOperationUid", sysOperationUid).ignoreCase());
			list = crit.list();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return list;
	}

}
